import { DB } from "@/lib/db";
import { faker } from "@faker-js/faker";
import { mobileCountry, MobileCountrySchema } from "@supersavely/db/schema";

const mock = () => {
  const data: Omit<
    Extract<MobileCountrySchema, { mode: "addMobileCountry" }>,
    "mode"
  >[] = [];

  data.push({
    country: "Australia",
    code: "+61",
    imageUrl: "https://www.worldometers.info/img/flags/small/tn_as-flag.gif",
  });
  data.push({
    country: "Mongolia",
    code: "+976",
    imageUrl: "https://www.worldometers.info/img/flags/small/tn_mg-flag.gif",
  });
  data.push({
    country: "Bangladesh",
    code: "+880",
    imageUrl: "https://www.worldometers.info/img/flags/small/tn_bg-flag.gif",
  });
  data.push({
    country: "China",
    code: "+86",
    imageUrl: "https://www.worldometers.info/img/flags/small/tn_ch-flag.gif",
  });
  data.push({
    country: "India",
    code: "+91",
    imageUrl: "https://www.worldometers.info/img/flags/small/tn_in-flag.gif",
  });
  data.push({
    country: "Bhutan",
    code: "+975",
    imageUrl: "https://www.worldometers.info/img/flags/small/tn_bt-flag.gif",
  });
  return data;
};

export async function seed(db: DB) {
  console.log("start seeding mobileCountry");
  await db.insert(mobileCountry).values(mock());
}
